import Vue from 'vue'
import Vuex from 'vuex'
// 挂载vuex
Vue.use(Vuex)
// 创建Vuex对象
const store = new Vuex.Store({
	state:{
		// 存储的值




		name:'huayu',
		info:{
			name:'鼎音',age:'2'
		},
		students: [
		  {id: 1, name: 'kobe', age: 18},
		  {id: 2, name: 'lucy', age: 21},
		  {id: 3, name: 'lilei', age: 30},
		  {id: 4, name: 'jack', age: 12}
	  ]
	},
	mutations:{
		getUser(state,payload){
			state.info={...state.students,'height':payload.height}
		},
    getStudent(state,payload){
        state.info={...state.students,'name':payload.name}
    }
	},
	actions:{

	}
})
export default store